<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class SubOneIamgeCate extends Base
{
    public static function add($map)
    {
        //判断是否存在改项分类
        $rew = self::where('name',$map['name'])
            ->where('pid',$map['pid'])
            ->get();
        if($rew->isEmpty()){
            $result = self::create($map);
            if($result){
                return 200;
            }
        }else{
            return 400;
        }
    }


    public static function SubOneIamgeCate()
    {
        $model = self::where('pid',0)->get();
        return $model;
    }



}
